package net.xdclass.service;

import net.xdclass.controller.request.ConfirmOrderRequest;
import net.xdclass.controller.request.ProductOrderPageRequest;
import net.xdclass.enums.ProductOrderPayTypeEnum;
import net.xdclass.model.EventMessage;
import net.xdclass.util.JsonData;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author Administrator
 * @description
 * @since 2023-06-26 21:30
 */
public interface ProductOrderService {

    /**
     * 分页查询订单
     * @param page
     * @param size
     * @param state
     * @return
     */
    Map<String, Object> page(ProductOrderPageRequest orderPageRequest);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    /**
     * 下单接口
     * @param orderRequest
     * @param response
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest orderRequest);

    /**
     * 挂壁订单
     * @param eventMessage
     */
    boolean closeProductOrder(EventMessage eventMessage);

    /**
     * 处理支付回调通知，修改订单状态
     * @param productOrderPayTypeEnum
     * @param dataMap
     */
    JsonData processOrderCallbackMsg(ProductOrderPayTypeEnum productOrderPayTypeEnum, Map dataMap);

    /**
     * 处理队列订单相关消息
     * @param eventMessage
     */
    void handleProductOrderMessage(EventMessage eventMessage);
}
